GETGROUPS

Section: System Calls (2)
Index Return to Main Contents

BSD mandoc
BSD 4.2  

NAME

getgroups - get group access list  

SYNOPSIS

Fd #include <sys/param.h> Fd #include <sys/types.h> Fd #include <unistd.h> Ft int Fn getgroups int gidsetlen gid_t *gidset  

DESCRIPTION

Fn Getgroups gets the current group access list of the current user process and stores it in the array Fa gidset . The parameter Fa gidsetlen indicates the number of entries that may be placed in Fa gidset . Fn Getgroups returns the actual number of groups returned in Fa gidset . No more than {NGROUPS_MAX} will ever be returned. If Fa gidsetlen is 0, Fn getgroups returns the number of groups without modifying the Fa gidset array.  

RETURN VALUES

A successful call returns the number of groups in the group set. A value of -1 indicates that an error occurred, and the error code is stored in the global variable errno  

ERRORS

The possible errors for Fn getgroups are:

Bq Er EINVAL
The argument Fa gidsetlen is smaller than the number of groups in the group set.
Bq Er EFAULT
The argument Fa gidset specifies an invalid address.

 

SEE ALSO

setgroups(2), initgroups(3)  

HISTORY

The Fn getgroups function call appeared in BSD 4.2


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
ERRORS
SEE ALSO
HISTORY

This document was created by man2html, using the manual pages.
Time: 16:28:59 GMT, April 18, 2022